begintownscript;

variables;

short bmessage,combat,rctx,lever,pcs,others_ok,twondx;
string custom_m;

body;

beginstate INIT_STATE;

	set_char_dialogue_pic(10,542,0);
	set_char_dialogue_pic(6,540,0);

	if(get_flag(26,0) >= 32){
		rctx = 45;
		while(rctx <= 47){
			set_terrain(rctx,36,137);
			rctx = (rctx + 1);
		}
		erase_char(10);
		move_item_on_spot(37,15,-1,-1);
		move_item_on_spot(39,15,-1,-1);
	}

	if(get_flag(44,0) == 1){
		set_terrain(31,8,30);
		set_terrain(32,8,30);
		set_terrain(33,8,30);
		set_terrain(10,31,31);
		set_terrain(10,32,31);
		set_terrain(10,33,31);
		set_terrain(31,54,32);
		set_terrain(32,54,32);
		set_terrain(33,54,32);
		set_terrain(53,31,33);
		set_terrain(53,32,33);
		set_terrain(53,33,33);
	}
	if(get_flag(45,0) == 1){
		set_terrain(19,28,30);
	}
	if(get_flag(46,0) == 1){
		set_terrain(14,28,30);
	}
	if(get_flag(47,0) == 1){
		set_terrain(28,16,31);
	}
	if(get_flag(48,0) == 1){
		set_terrain(16,15,30);
		set_terrain(17,15,30);
	}
	if(get_flag(49,0) == 1){
		set_terrain(45,28,30);
	}
	if(get_flag(50,0) == 1){
		set_terrain(36,19,33);
	}

	if(get_flag(26,0) == 26){
		force_instant_terrain_redraw();

		reset_dialog();
		add_dialog_str(0,"Oh...  Good lord...",0);
		add_dialog_str(1,"There is nobody guarding the gate to greet you.  Instead, you are greeted by the smell of blood, and copious amounts of it.  The fort was attacked.",0);
		add_dialog_str(2,"Were there any survivors?  But more importantly, is anyone here still alive?  Friends?  Foes?",0);
		if(get_flag(99,0) == 1){
			add_dialog_str(3,"Malachai!  Did he know about this?  Maybe he did, and maybe that's why he let you sleep later...  Maybe he spared your life.  He could have said goodbye, but...  No, you'd have followed for sure.",0);
			add_dialog_str(4,"Maybe he's still okay.  He's a fierce warrior...  He has the potential, if anyone does, of defeating the menace here.",0);
			add_dialog_str(5,"You hear the sounds of combat.  It's faint and in the distance, but you can hear it.  Malachai!  This may be your chance to save him.",0);
		}
		if(get_flag(99,0) == 2){
			add_dialog_str(3,"Casimir!  He's the only one who could have done this.  Is this what he meant when he said revenge on the world?  Or maybe he was ordered to do this by the enigmatic Sabertooth...",0);
			add_dialog_str(4,"Perhaps he's still here, reveling in his apparent victory.  Maybe he's already dead.  Either way, if he isn't now, he will be...  He will be.",0);
			add_dialog_str(5,"You hear the sounds of combat.  It's faint and in the distance, but you can hear it.  Casimir!  This may be your chance to take him down!",0);
		}
		if(party_size() > 1)
			add_dialog_choice(0,"Let's go!");
		if(party_size() == 1)
			add_dialog_choice(0,"No time to waste!");
		bmessage = run_dialog(1);

		set_flag(26,0,27);
	}

	if(get_flag(55,0) == 1){
		force_instant_terrain_redraw();
		message_dialog("Sure enough.  The gates have already been closed.  This means the end, doesn't it?  Your adventure, it's over.","");
		set_flag(55,0,2);
	}

	if(get_flag(26,0) == 61 && get_flag(60,0) > 1){

		activate_hidden_group(10);
		relocate_character(0,42,32);
		set_character_facing(0,6);
		pcs = 1;
		while(pcs <= 3){
			if(char_ok(pcs) == TRUE){
				relocate_character(pcs,47,(30 + pcs));
				set_character_facing(pcs,2);
			}
			pcs = (pcs + 1);
		}

		force_view_center(42,32);
		force_instant_terrain_redraw();
		pause(6);

		reset_dialog();
		clear_buffer();
		pcs = 1;
		while(pcs <= 3){
			if(char_ok(pcs) == TRUE){
				others_ok = (pcs + 1);
				twondx = 0;
				while(others_ok < 4 && twondx < 2){
					if(char_ok(others_ok) == 1){
						twondx = (twondx + 1);
					}
					others_ok = (others_ok + 1);
				}
				if(twondx == 1){
					append_char_name(pcs);
					append_string(", and ");
				}
				if(twondx > 1){
					append_char_name(pcs);
					append_string(", ");
				}
				if(twondx == 0){
					append_char_name(pcs);
					append_string("!  ");
				}
			}
			pcs = (pcs + 1);
		}
		if(get_flag(60,0) == 2)
			append_string("Your friend is ");
		if(get_flag(60,0) > 2)
			append_string("Your friends are ");
		append_string("okay!  But...  How did this happen?");
		get_buffer_text(custom_m);
		add_dialog_str(0,custom_m,0);
		if(party_size() > 2)
			add_dialog_str(1,"They're being held in ropes by a group of three nephils.  Odd thing is, they don't seem to mind it one bit- they actually seem to be happier now that you're back.",0);
		if(party_size() == 2)
			add_dialog_str(1,"Your comrade is being held in ropes by a group of three nephils.  Odd thing is, the captive partner doesn't seem to mind it one bit- your friend actually seems to be happier now that you're back.",0);
		add_dialog_str(2,"One of the nephils pulls out a letter and begins reading it in painfully broken Imperial Common.  The characters must be in its language, but the sounds come out clearly enough.",0);
		if(party_size() > 2)
			add_dialog_str(3,"_Dea Soldar, I am happa to see you heya.  Your libing means thad Sabartood has bien defietad.  In retarn fo doing thies, I am gibing you your frands back to you._",0);
		if(party_size() > 2)
			add_dialog_str(3,"_Dea Soldar, I am happa to see you heya.  Your libing means thad Sabartood has bien defietad.  In retarn fo doing thies, I am gibing you your frand back to you._",0);
		add_dialog_str(4,"_Go back to Karsash (that must be Kalzas) and samman the Empara heya so thad we mait do batta togezar.  Siened, Ratbien the Fotiens._",0);
		if(party_size() == 2)
			add_dialog_str(5,"The nephilim cut the ropes on your partner, and apparently having forgotten the rest of their directive to let you go peacefully, attack.",0);
		if(party_size() > 2)
			add_dialog_str(5,"The nephilim cut the ropes on your partners, and apparently having forgotten the rest of their directive to let you go peacefully, attack.",0);
		bmessage = run_dialog(1);

		set_flag(60,0,0);

	}

	if(character_in_party(700) == TRUE){
		erase_char(6);
	}

break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;

	if(get_flag(26,0) >= 29 && get_flag(99,2) < 2){
		combat = get_ran(1,0,1);
		while((combat) > 0){
			play_sound(70);
			if(get_ran(1,0,1) == 0){
				play_sound(70);
			}
			combat = (combat - 1);
		}
	}

	if(has_item(482) == TRUE){
		change_spec_item(1,1);
		take_all_of_item(482);
	}

	if(get_flag(39,0) == 6){
		reset_dialog();
		add_dialog_str(0,"That's it...  It's over, isn't it?",0);
		add_dialog_str(1,"The fort has been ransacked, all of its soldiers have been killed.  Whatever defensive benefit Ivalice once had is now gone.  All that's left is the walls, and those can only help the nephils when they man them.",0);
		add_dialog_str(2,"Kalzas would want to hear about this.  Some of the people in that city might be able to order new troops into this rapidly worsening situation.",0);
		add_dialog_str(3,"But...  There were only ten corpses lying on the ground where Zenbu attacked.  With Malachai, that only makes eleven corpses.  There were twelve soldiers here.",0);
		add_dialog_str(4,"Maybe the last one fled.  Maybe not.  Who knows.",0);
		add_dialog_str(5,"Regardless, one thing is for certain.  Whatever chance you stood before deciding to help Malachai, it is now drastically reduced.  Finishing this will be drastically more difficult than before, perhaps suicidal.",0);
		bmessage = run_dialog(1);
		set_flag(39,0,7);
	}

break;

beginstate 10;

	if(get_flag(26,0) < 28){
		if(get_flag(99,0) == 1)
			message_dialog("They were all slaughtered...  They didn't stand a chance.  What a sorrow...  Still, you don't see Malachai's corpse amongst them.  He might still be alive!","But there seems to only be ten corpses here, despite there's being twelve soldiers.  If Malachai is still alive, then who else?  No matter, to the combat first.");
		if(get_flag(99,0) == 2)
			message_dialog("They were all slaughtered...  They didn't stand a chance.  Casimir, you bastard...  Still, you don't see Malachai's corpse amongst them.  He might still be alive!","But there seems to only be ten corpses here, despite there's being twelve soldiers.  If Malachai is still alive, then who's the coward?  No matter, to the combat first.");
		set_flag(26,0,28);
	}

break;

beginstate 11;

	if(get_flag(26,0) == 28){
		message_dialog("You can hear the sounds of swords slashing more distinctly now.  It's to the southeast.","");
		set_flag(26,0,29);
	}

break;

beginstate 12;

	if(get_flag(26,0) == 29){
		message_dialog("The fighting is most definitely coming from the forge to the east.","");
		set_flag(26,0,30);
	}

break;

beginstate 13;

	if(get_flag(26,0) == 30){
		if(get_flag(99,0) == 1)
			message_dialog("They're battling behind these curtains...  Be prepared.","It's time to try.  It's time to puff out your chest and be your finest.  This is the final fight.");
		if(get_flag(99,0) == 2)
			message_dialog("They're battling behind these curtains...  Be prepared.","Casimir.  You will cut him down.  This is the final fight.");
		set_flag(26,0,31);
	}

break;

beginstate 14;

	if(get_flag(26,0) == 31){

		set_flag(26,0,32);

		activate_hidden_group(1);
		set_character_pose(7,2);
		set_character_pose(8,2);

		if(get_flag(99,0) == 1)
			text_bubble_on_char(0,"Malachai!");
		if(get_flag(99,0) == 2)
			text_bubble_on_char(0,"Casimir!");
		rctx = 43;
		while(rctx <= 46){
			march_party(rctx,(94 - rctx));
			force_view_center(rctx,(94-rctx));
			set_character_pose(1000,0);
			force_instant_terrain_redraw();
			pause(2);

			if(rctx == 44){
				set_character_pose(8,1);
				put_effect_on_char(7,12,1,2);
				force_instant_terrain_redraw();
				run_animation_sound(69);
				pause(1);
			}

			if(rctx == 45){
				set_character_pose(8,2);
			}

			if(rctx == 46){
				set_character_pose(7,1);
				put_effect_on_char(8,12,1,2);
				force_instant_terrain_redraw();
				run_animation_sound(69);
				pause(1);
				set_character_pose(7,2);
				text_bubble_on_char(0,"");
				force_instant_terrain_redraw();
				pause(1);
			}

			rctx = (rctx + 1);
		}

		clear_buffer();
		append_char_name(0);
		append_string("!");
		get_buffer_text(custom_m);
		text_bubble_on_char(7,custom_m);
		force_instant_terrain_redraw();
		pause(5);

		text_bubble_on_char(7,"");
		text_bubble_on_char(7,"Why...");
		set_character_pose(7,1);
		set_character_pose(8,1);
		force_instant_terrain_redraw();
		play_sound(70);
		pause(5);

		text_bubble_on_char(7,"are you here?!");
		set_character_pose(7,2);
		set_character_pose(8,2);
		force_instant_terrain_redraw();
		play_sound(19);
		pause(7);

		text_bubble_on_char(7,"");
		set_character_facing(8,6);
		force_instant_terrain_redraw();
		play_sound(2);
		pause(2);

		text_bubble_on_char(8,"Teaming up on me?!");
		force_instant_terrain_redraw();
		pause(8);

		text_bubble_on_char(8,"");
		if(get_flag(99,0) == 1)
			text_bubble_on_char(0,"Die, Zenbu!");
		if(get_flag(99,0) == 2)
			text_bubble_on_char(0,"Die, Casimir!");
		march_party(45,47);
		force_view_center(45,47);
		set_character_facing(8,4);
		set_character_pose(0,2);
		set_character_pose(8,2);
		force_instant_terrain_redraw();
		pause(7);

		text_bubble_on_char(0,"");
		if(get_flag(99,0) == 1)
			text_bubble_on_char(7,"Don't do it!");
		if(get_flag(99,0) == 2)
			text_bubble_on_char(7,"...Casimir?");
		text_bubble_on_char(8,"Damnation!");
		force_instant_terrain_redraw();
		pause(8);

		text_bubble_on_char(7,"");
		text_bubble_on_char(8,"");
		text_bubble_on_char(8,"Take that!");
		relocate_character(0,44,49);
		force_view_center(44,49);
		set_character_pose(0,14);
		put_effect_on_char(0,12,1,2);
		force_instant_terrain_redraw();
		damage_char(0,(get_health(0) - 1),4);
		run_animation_sound(72);
		pause(4);
		play_sound(3);
		pause(4);
		message_dialog("That was rough- fortunately, he didn't hit any of your vitals.","");

		clear_buffer();
		append_string("No!  ");
		append_char_name(0);
		append_string("!");
		get_buffer_text(custom_m);
		text_bubble_on_char(7,custom_m);
		force_instant_terrain_redraw();
		pause(7);

		text_bubble_on_char(7,"");
		text_bubble_on_char(8,"");
		set_character_facing(8,0);
		set_character_pose(8,2);
		put_sparkles_on_char(8,11,get_ran(1,4,7));
		force_instant_terrain_redraw();
		run_animation_sound(12);
		pause(2);

		set_character_pose(8,1);
		erase_char(7);
		relocate_character(10,45,44);
		set_character_pose(10,14);
		move_item_on_spot(39,15,45,45);
		put_effect_on_char(10,12,1,2);
		force_instant_terrain_redraw();
		run_animation_sound(72);
		pause(5);

		erase_char(8);
		activate_hidden_group(2);
		relocate_character(9,45,46);
		move_item_on_spot(45,45,-1,-1);
		move_item_on_spot(37,15,45,46);
		force_instant_terrain_redraw();
		play_sound(135);
		pause(4);

		text_bubble_on_char(9,"Finally!");
		force_instant_terrain_redraw();
		pause(12);

		text_bubble_on_char(9,"");
		text_bubble_on_char(9,"The dervish is no more.");
		force_instant_terrain_redraw();
		pause(12);

		set_character_facing(9,4);
		text_bubble_on_char(9,"");
		text_bubble_on_char(9,"As for you...");
		force_instant_terrain_redraw();
		pause(12);

		text_bubble_on_char(9,"");
		text_bubble_on_char(9,"You will come to me.");
		force_instant_terrain_redraw();
		pause(12);

		text_bubble_on_char(9,"");
		text_bubble_on_char(9,"I will show you");
		force_instant_terrain_redraw();
		pause(12);

		text_bubble_on_char(9,"");
		if(get_flag(99,0) == 1)
			text_bubble_on_char(9,"how to kill my master");
		if(get_flag(99,0) == 2)
			text_bubble_on_char(9,"how to kill Sabertooth");
		force_instant_terrain_redraw();
		pause(15);

		text_bubble_on_char(9,"");
		text_bubble_on_char(9,"and take revenge");
		force_instant_terrain_redraw();
		pause(15);

		text_bubble_on_char(9,"");
		text_bubble_on_char(9,"on Chika.");
		force_instant_terrain_redraw();
		pause(15);

		text_bubble_on_char(9,"");
		if(get_flag(99,0) == 1)
			text_bubble_on_char(0,"Wait, Zenbu...!");
		if(get_flag(99,0) == 2)
			text_bubble_on_char(0,"Wait, Casimir...!");
		force_instant_terrain_redraw();
		pause(6);

		text_bubble_on_char(0,"");
		set_character_facing(9,0);
		rctx = 45;
		while(rctx >= 40){
			relocate_character(9,46,rctx);
			force_instant_terrain_redraw();
			pause(2);

			rctx = (rctx - 1);
		}
		play_sound(108);
		pause(4);
		rctx = 45;
		while(rctx <= 47){
			set_terrain(rctx,36,137);
			rctx = (rctx + 1);
		}
		erase_char(9);
		if(get_flag(99,0) == 1)
			message_dialog("Zenbu, seemingly effortlessly, wipes out the wall behind you.  He's strong...  A fearsome foe...  Who's getting away...","");
		if(get_flag(99,0) == 2)
			message_dialog("Casimir, seemingly effortlessly, wipes out the wall behind you.  He's strong...  A fearsome foe...  Who's getting away...","");

		text_bubble_on_char(10,"Nggh...  Come...");
		force_instant_terrain_redraw();
		pause(10);

		text_bubble_on_char(10,"");
		message_dialog("Malachai!  He's practically a cadaver.  But he is not yet entirely dead.","_Nggh!  No...  Not yet!  Please, friend, come to my side..._");
		set_character_pose(0,0);
		force_instant_terrain_redraw();

		rctx = 48;
		while(rctx >= 45){
			march_party(44,rctx);
			force_view_center(44,rctx);
			force_instant_terrain_redraw();
			pause(3);

			rctx = (rctx - 1);
		}

		block_entry(1);

		set_flag(99,2,2);
	}

break;

beginstate 15;

	if(get_flag(26,0) == 32){
		message_dialog("_Wait...  Please..._","No.  This is the man's final request.");
		block_entry(1);
	}

break;

beginstate 16;

	if(get_flag(26,0) < 33){
		print_str_color("Wrong way!",1);
		block_entry(1);
	}

break;

beginstate 17;

	if(get_flag(8,0) == 1){
		if(get_flag(99,0) == 1)
			message_dialog("Maxwell...  You never had anything to be guilty of.  You served Malachai finely indeed.  Whatever cowardice you had shown has certainly been redeemed.","");
		if(get_flag(99,0) == 2)
			message_dialog("Maxwell...  You poor son of a bitch.  Slain by a comrade and friend in arms, without knowing edgewise.","");
		set_flag(8,0,2);
	}

break;

beginstate 18;

	if(get_flag(9,0) == 1){
		if(get_flag(99,0) == 1)
			message_dialog("Lloyd...  What drove you to be so violent?  Did you die happy, or merely enraged?  What was floating in your perturbed mind?","");
		if(get_flag(99,0) == 2)
			message_dialog("Lloyd...  Most people do not suffer deaths as luxurious as yours indeed.","");
		set_flag(9,0,2);
	}

break;

beginstate 19;

	if(get_flag(10,0) == 1){
		if(get_flag(99,0) == 1)
			message_dialog("Janet, you were a generous soul...  Everyone here died with a mite of contentedness from your efforts.","");
		if(get_flag(99,0) == 2)
			message_dialog("Poor Janet, being pretty did not help you survive any.  Did you get satisfaction from it?","");
		set_flag(10,0,2);
	}

break;

beginstate 20;

	if(get_flag(11,0) == 1){
		if(get_flag(99,0) == 1)
			message_dialog("Acacia, who is this that stands in front of you?  There is an wound through her chest...  Are you surprised?  Are you happy?","");
		if(get_flag(99,0) == 2)
			message_dialog("Acacia...  Looks like you won't see me dead before you, hunh?  Friggin' psychopath.","");
		set_flag(11,0,2);
	}

break;

beginstate 21;

	if(get_flag(12,0) == 1){
		if(get_flag(99,0) == 1)
			message_dialog("Isabel...  The wound, it goes through your arms before piercing your chest.  Did you take this blow knowingly?  Did you take it for her?","");
		if(get_flag(99,0) == 2)
			message_dialog("Isabel...  You went too far.  This wound on your chest, it's too clumbsy for Zenbu to have made wittingly.  You dived in front of it, didn't you?","");
		set_flag(12,0,2);
	}

break;

beginstate 22;

	if(get_flag(13,0) == 1){
		message_dialog("Hunter...  You had problems too, didn't you?  For someone who talked about the problems of others, it must have been difficult for you too.  Are you happy now, Hunter?","");
		set_flag(13,0,2);
	}

break;

beginstate 23;

	if(get_flag(14,0) == 1){
		if(get_flag(99,0) == 1)
			message_dialog("Ivy...  Everyone here, they are all better for your service.  Your presence, it inspired them...  Be proud.","");
		if(get_flag(99,0) == 2)
			message_dialog("Ivy...  So, what does death feel like?  Did your deeds make you any happier?  Did you live any longer because of them?","");
		set_flag(14,0,2);
	}

break;

beginstate 24;

	reset_dialog();
	add_dialog_str(0,"There is a platform here, but rather than having anything placed on it, it has three large and clearly labeled switches.  The switches don't stay in place, and can be used to open or close the gates.",0);
	add_dialog_str(1,"Which switches you press depends on what you want to do...",0);
	add_dialog_choice(0,"Open some gates.");
	add_dialog_choice(1,"Close some gates.");
	add_dialog_choice(2,"Nothing!  Nevermind.");
	bmessage = run_dialog(0);

	if(bmessage == 3){
		end();
	}

	if(bmessage == 1){
		reset_dialog();
		add_dialog_str(0,"Which gates?",0);
		add_dialog_choice(0,"Main Gates");
		add_dialog_choice(1,"Administrative Gates");
		add_dialog_choice(2,"Mining Gates");
		lever = run_dialog(0);

		if(lever == 1){
			set_terrain(31,8,30);
			set_terrain(32,8,30);
			set_terrain(33,8,30);
			set_terrain(10,31,31);
			set_terrain(10,32,31);
			set_terrain(10,33,31);
			set_terrain(31,54,32);
			set_terrain(32,54,32);
			set_terrain(33,54,32);
			set_terrain(53,31,33);
			set_terrain(53,32,33);
			set_terrain(53,33,33);
			set_flag(44,0,1);
		}
		if(lever == 2){
			set_terrain(45,28,30);
			set_terrain(36,19,33);
			set_flag(49,0,1);
			set_flag(50,0,1);
		}
		if(lever == 3){
			set_terrain(28,16,31);
			set_terrain(19,28,30);
			set_terrain(14,28,30);
			set_terrain(16,15,30);
			set_terrain(17,15,30);
			set_flag(45,0,1);
			set_flag(46,0,1);
			set_flag(47,0,1);
			set_flag(48,0,1);
		}
		play_sound(99);
		play_sound(99);
		play_sound(99);
	}

	if(bmessage == 2){
		reset_dialog();
		add_dialog_str(0,"Which gates?",0);
		add_dialog_choice(0,"Main Gates");
		add_dialog_choice(1,"Administrative Gates");
		add_dialog_choice(2,"Mining Gates");
		lever = run_dialog(0);

		if(lever == 1){
			set_terrain(31,8,26);
			set_terrain(32,8,26);
			set_terrain(33,8,26);
			set_terrain(10,31,27);
			set_terrain(10,32,27);
			set_terrain(10,33,27);
			set_terrain(31,54,28);
			set_terrain(32,54,28);
			set_terrain(33,54,28);
			set_terrain(53,31,29);
			set_terrain(53,32,29);
			set_terrain(53,33,29);
			set_flag(44,0,0);
		}
		if(lever == 2){
			set_terrain(45,28,26);
			set_terrain(36,19,29);
		}
		if(lever == 3){
			set_terrain(28,16,27);
			set_terrain(19,28,26);
			set_terrain(14,28,26);
			set_terrain(16,15,26);
			set_terrain(17,15,26);
		}
		play_sound(99);
		play_sound(99);
		play_sound(99);
	}

break;

beginstate 25;

	if(get_flag(39,0) >= 7 && get_flag(26,0) < 34){
		message_dialog("For that matter, now that you think of it, why were the gates to the northwestern building closed?  Is there a way to open them?","Maybe, that's where the survivor went...  It's a long-shot, but more surprising things have happened before, and it certainly can't hurt to try.");
		set_flag(26,0,34);
	}

break;

beginstate 26;

	if(get_flag(40,0) == 0){
		message_dialog("Nobody in here...  It's as empty as they come.","");
		set_flag(40,0,1);
	}

break;

beginstate 27;

	if(get_flag(41,0) == 0){
		message_dialog("Nobody in here...  It's as empty as they come.","");
		set_flag(41,0,1);
	}

break;

beginstate 28;

	if(get_flag(42,0) == 0){
		message_dialog("Nobody in here...  It's as empty as they come.","");
		set_flag(42,0,1);
	}

break;

beginstate 29;

	if(get_flag(43,0) == 0){
		message_dialog("Nobody in here...  It's as empty as they come.","");
		set_flag(43,0,1);
	}

break;

beginstate 30;

	if(get_flag(26,0) < 35){
		clear_buffer();
		append_string("_What...  You, ");
		append_char_name(0);
		append_string("?  What are you ");
		if(party_size() > 2){
			append_string("and your friends ");
		}
		if(party_size() == 2){
			append_string("and ");
			pcs = 1;
			while(char_ok(pcs) == FALSE){
				pcs = (pcs + 1);
			}
			append_char_name(pcs);
			append_string(" ");
		}
		append_string("doing here?  Nevermind that, what shape is this fort in?  Come on, man!  Talk to me!  I need to know!_  He may not be pleased, but you should at least speak with him...");
		get_buffer_text(custom_m);
		message_dialog("You turn the corner to find a very surprised soldier grasping his sword desperately.  It takes you a moment to recognize him, but sure enough, it's Anthony!",custom_m);

		set_flag(26,0,35);
	}

break;

beginstate 31;

	if(get_flag(26,0) == 35){
		print_str_color("Talk to Anthony first!",1);
		block_entry(1);
	}

break;

beginstate 32;

	if(get_flag(26,0) < 37){
		message_dialog("Anthony extends his sword wide enough to cover the stairway's entrance.","_Hey!  If you want to go down there, talk with me first._");
		block_entry(1);
		end();
	}

	move_to_new_town(3,7,55);

break;

beginstate 33;

	if(get_flag(26,0) == 61){
		message_dialog("It's...  Over.  The fortress is locked up soundly, meaning that you won't be able to wreak any more havoc on the nephilim, but truth be told, you did enough.","A good number of soldiers, their general, their champion and their mastermind are all out of the picture.  This rebellion is over, whenever you get to Kalzas to bring forth the Imperial Army.  Time to do what must be done.");
		set_flag(26,0,62);
		set_flag(99,1,1);
		award_party_xp(500,20);
		award_party_xp(500,20);
		award_party_xp(500,20);
		award_party_xp(500,20);
		award_party_xp(500,20);
		award_party_xp(500,20);
	}

break;

